﻿package net.jejer.autoproxy2pac3;
import java.io.IOException;
import javax.servlet.http.*;

//Data
import javax.jdo.PersistenceManager;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

import net.jejer.autoproxy2pac3.PMF;
import net.jejer.autoproxy2pac3.PacData;

@SuppressWarnings("serial")
public class AutoProxy2Pac3Servlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		resp.setContentType("text/plain");
		PersistenceManager pm = PMF.get().getPersistenceManager();
		Key k = KeyFactory.createKey(PacData.class.getSimpleName(), "SSH");
		
		try {
			PacData pacData = pm.getObjectById(PacData.class, k);
			resp.getWriter().println(pacData.getModify());
		} finally {
            pm.close();
        }
	}
}
